package com.huawei.esdk.tp.device.smc.v100r003c10;

import java.util.List;
import com.huawei.esdk.platform.common.SDKResult;
import com.huawei.esdk.platform.commu.itf.ICXFSOAPProtocolAdapter;
import com.huawei.esdk.platform.exception.ProtocolAdapterException;
import com.huawei.esdk.tp.device.smc.V1R1C01BaseCapability;
import com.huawei.esdk.tp.device.smc.v100r003c10.convert.TPSMC20V1R3C10OrgaMgrConvert;
import com.huawei.esdk.tp.domain.model.bean.OrganizationItem;
import com.huawei.esdk.tp.southcommu.cxf.gen.v100r003c10.QueryOraganization;
import com.huawei.esdk.tp.southcommu.cxf.gen.v100r003c10.QueryOraganizationResponse;
import com.huawei.esdk.tp.southcommu.cxf.gen.v100r003c10.SmcExternal2Soap;

public class SMC20V1R3C10OrgaManagerCapabilityimpl extends V1R1C01BaseCapability implements
    SMC20V1R3C10IOrgaManagerCapability
{
    private TPSMC20V1R3C10OrgaMgrConvert tpOrgaMgrConvertService = new TPSMC20V1R3C10OrgaMgrConvert();
    
    public SMC20V1R3C10OrgaManagerCapabilityimpl(ICXFSOAPProtocolAdapter cxfSOAPProtocolAdapter)
    {
        super(cxfSOAPProtocolAdapter);
    }
    
    protected String getR3C10SouthItfName()
    {
        return SmcExternal2Soap.class.getName();
    }
    
    @Override
    public SDKResult<List<OrganizationItem>> queryOrganization()
    {
        SDKResult<List<OrganizationItem>> result = new SDKResult<List<OrganizationItem>>();
        QueryOraganizationResponse responseSouth = null;
        try
        {
            QueryOraganization resMsg = new QueryOraganization();
            responseSouth =
                (QueryOraganizationResponse)sendProtocolMessage(resMsg, getR3C10SouthItfName(), "queryOraganization");
            result = tpOrgaMgrConvertService.queryOrganizationSoap2model(responseSouth);
        }
        catch (ProtocolAdapterException e)
        {
            result.setErrCode(e.getErrorCode());
            return result;
        }
        return result;
    }
    
}
